<?php
/**
 * @link https://ym2.cleverstone.top
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */
/* @var \yii\web\View $this */
use backend\assets\SiteAsset;
use builder\helper\App;

$flashError = Yii::$app->session->getFlash(App::params('admin.session.flash.error'));

SiteAsset::register($this);
$this->title = '登录';
?>
<div class="login-container" ng-controller="ym2.ctrl.site.login">
    <!--闪存错误信息-->
    <?php if (!empty($flashError)): ?>
    <div class="position-fixed fixed-top">
        <div class="alert alert-danger text-center">
            <?= $flashError ?>
        </div>
    </div>
    <?php endif; ?>

    <!--左侧主题-->
    <div class="left-block">
        <!--风格1--><!--这里主题图-->
<!--        <div class="style-first text-center">-->
<!--            <img src="/media/image/login/login_box.png" alt>-->
<!--            <img class="mb-5" src="/media/image/login/login_box.svg" alt>-->
<!--            <img class="mb-5" src="/media/image/login/login_box0.png" alt>-->
<!--            <h1 class="d-flex justify-content-center anim-sort-in">--><?php //= App::params('admin.brandName') ?><!--</h1>-->
<!--            <p class="pt-3 f14 anim-sort-in">--><?php //= App::params('admin.slogan') ?><!--</p>-->
<!--        </div>-->

        <!--风格二-->
        <!--支持 style-second / style-third / style-fourth-->
<!--        <div class="style-second">-->
<!--            <div class="text-primary pc-body pc-bg flex-grow-1 flex-shrink-0 h-100 d-flex flex-column align-items-center justify-content-center p-4">-->
<!--                <h1 class="d-flex justify-content-center anim-sort-in anim-sort-in-text-shadow">--><?php //= App::params('admin.brandName') ?><!--</h1>-->
<!--                <p class="pt-5 f14 anim-sort-in">--><?php //= App::params('admin.slogan') ?><!--</p>-->
<!--            </div>-->
<!--        </div>-->
        <!--风格三-->
        <div class="style-another w-100 h-100 d-flex flex-column align-items-center justify-content-center">
            <h1 class="font-weight-bold anim-sort-in"><?= App::params('admin.brandName') ?></h1>
            <p class="pt-4 f15 anim-sort-in"><?= App::params('admin.slogan') ?></p>
        </div>
    </div>
    <div class="right-block position-relative">
        <!--登录表单-->
        <form class="layui-form pb-35" name="LoginForm">
            <div ng-show="errorMessage" class="alert alert-danger d-flex align-items-center">
                <i class="layui-icon layui-icon-tips-fill"></i>
                <span class="pl-2">{{ errorMessage }}</span>
            </div>
            <h2 class="login-title py-3 font-weight-bold">登录</h2>
            <div class="form-group layui-input-wrap w-380">
                <div class="layui-input-prefix">
                    <i class="bi bi-person f18"></i>
                </div>
                <input type="text" name="username" placeholder="账号" ng-model="username" class="ym2-form-control layui-input f14" lay-affix="clear" lay-filter="clear">
            </div>
            <div class="form-group layui-input-wrap w-380 form-password">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-password"></i>
                </div>
                <input type="password" name="password" ng-model="password" placeholder="密码" class="ym2-form-control layui-input f14" lay-affix="eye">
            </div>
            <div class="form-group w-380 mt-5">
                <button ng-if="!logining" class="btn btn-primary btn-lg w-100" ng-click="loginSubmit($event)">登录</button>
                <button ng-if="logining" class="btn btn-primary btn-lg w-100 disabled">
                    <i class="layui-icon layui-icon-loading-1 layui-anim layui-anim-rotate layui-anim-loop"></i>
                    登录中...
                </button>
            </div>
        </form>
        <!--尾部-->
        <div class="page-footer p-4 position-absolute fixed-bottom text-muted">
            <p class="f12 text-center"><?= App::params('admin.copyright') ?></p>
            <p class="f12 text-center"><?= App::params('admin.icp') ?></p>
        </div>
    </div>
</div>
